package com.yxx.entityModel.vo.query;

import com.yxx.constant.PageConstant;
import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * 分页查询条件
 * @author yuxiangxun
 * @date 2025/1/22
 * @apiNote
 */
@Data
@ApiModel(description = "分页查询条件")
public class PageQuery {

    /**
     * 当前页
     */
    private Integer current;

    /**
     * 条数
     */
    private Integer size;

    /**
     * 获取当前页的
     * @return
     */
    public Integer getCurrent(){
        return current == null ? (PageConstant.DEFAULT_CURRENT-1) * getSize() : (current-1);
    }
}
